package com.lanyam.travel.base.dao;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lanyam.travel.base.entity.OrderGoodsDate;
import com.lanyam.travel.base.entity.vo.OrderGoodsDateVo;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author rosson
 * @since 2020-02-22
 */
public interface OrderGoodsDateMapper extends BaseMapper<OrderGoodsDate> {

	@Select("SELECT ogd.*,gi.good_name AS goodsName FROM order_goods_date ogd LEFT JOIN goods_info gi ON ogd.goods_id = gi.id WHERE ogd.order_id = #{orderId}")
	List<OrderGoodsDateVo> getHotelDatePrice(String orderId);

	@Select("SELECT ogd.*,tt.content AS goodsName\n" + 
			"FROM order_goods_date ogd \n" + 
			"LEFT JOIN product_ticket pt ON ogd.goods_id = pt.id \n" +
			"LEFT JOIN ticket_type tt ON pt.ticket_type_id = tt.id\n" + 
			"WHERE ogd.`order_id` = #{orderId}")
	List<OrderGoodsDateVo> getScenicDatePrice(String orderId);

}
